using ArmyAnt.ProcessController;
using PlayMyLife.Events;
using PlayMyLife.Present;
using PlayMyLife.View.Components;

namespace PlayMyLife.ViewModel {
    public static class GameViewManager {
        public static bool EnableOperate { get; private set; }
        public static IEventManager<DirectorEvent> EventMgr { get; private set; }

        public static void Init(EventMgr eventMgr, string eventConfig, string skillConfig) {
            EnableOperate = false;
            EventMgr = eventMgr;

            EventMgr.Listen(DirectorEvent.EnableOperate, OnEnableOperate);

            director = new OperaDirector(eventMgr, eventMgr, eventConfig, skillConfig);
        }

        private static void OnEnableOperate(IEventManager<DirectorEvent>.IEventArgs e) {
            if(e is EventArgs_EnableOperate arg) {
                EnableOperate = arg.Enable;
            }
        }

        private static OperaDirector director;
    }
}
